import IssueStatusBadge from "@/app/components/IssueStatusBadge";
import {Card, Flex, Heading, Text} from "@radix-ui/themes";
import React from 'react';
import ReactMarkdown from "react-markdown";
import {Issue} from ".prisma/client";

const IssueDetail = ({issue}:{issue:Issue}) => {
    return (
       <>
           <Heading as={"h2"}>Title:{issue.title}</Heading>
           <Flex className={"space-x-3"} my={"2"}>
               <IssueStatusBadge status={issue.status}/>
               <Text>{issue.createAt.toDateString()}</Text>
           </Flex>
           <Card>
               <ReactMarkdown className={"prose max-w-full"}>
                   {issue.description}
               </ReactMarkdown>
           </Card>
       </>
    );
};

export default IssueDetail;